- can_update_merge_request = can?(current_user, :update_merge_request, @merge_request)

- if @commits.empty? && @context_commits.empty?
  .commits-empty.mt-5
    = custom_icon ('illustration_no_commits')
    %h4
      = _('There are no commits yet.')
    - if can_update_merge_request
      %p
        = _('Push commits to the source branch or add previously merged commits to review them.')
      = render Pajamas::ButtonComponent.new(variant: 'confirm', button_options: { class: 'add-review-item-modal-trigger', data: { commits_empty: 'true', context_commits_empty: 'true' } }) do
        = _('Add previously merged commits')
- else
  %ol#commits-list.list-unstyled
    = render "projects/commits/commits", merge_request: @merge_request
  - if @next_page && @merge_request
    = render Pajamas::ButtonComponent.new(button_options: { class: 'js-load-more-commits', data: { next_page: @next_page } }) do
      = _('Load more')

- if can_update_merge_request && @merge_request.iid && !@next_page
  .add-review-item-modal-wrapper{ data: { context_commits_path: context_commits_project_json_merge_request_url(@merge_request&.project, @merge_request, :json), target_branch: @merge_request.target_branch, merge_request_iid: @merge_request.iid, project_id: @merge_request.project.id } }
